<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>

<body>
<script>


var r = /((<\/?\w+>).*((<\/?\w+>))/g;
var a = s.match(r); 		// 返回数组["<h1>title</h1>","<p>text</p>"]



</script>
</body>
</html>
